package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/** 文件复制       */
public class CopyDemo {
    public static void main(String[] args) throws IOException {
    FileInputStream fis =  new FileInputStream("OIP.jpg");
    FileOutputStream  fox= new FileOutputStream("OIP_cp.jpg");
    long start= System.currentTimeMillis();//获取当前时间 毫秒数
        int d;
        while((d=fis.read())!=-1){
            fox.write(d);
        }
        long end= System.currentTimeMillis();
        System.out.println("耗时完毕"+(end-start)+"毫秒");
        fis.close();
        fox.close();
    }
}
